package com.sunmouse.paylib;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.kvin.toolkit.activity.OnBindInit;
import com.kvin.toolkit.activity.OnHandleMessageListener;
import com.kvin.toolkit.utils.http.JsonUtils;

/**
 * Created by Kvin on 2017/5/25.
 */
public class BaseActivity extends AppCompatActivity implements OnBindInit, View.OnClickListener, OnHandleMessageListener {
    private boolean isInitialized;

    protected final Handler mHanlder = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            onHandleMessage(msg);

        }
    };

    protected JsonUtils mJsonUtils;

    protected Message mMsg;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        isInitialized = false;
    }

    @Override
    protected void onStart() {
        super.onStart();
        if (!isInitialized) {
            isInitialized = true;
            init();
            initNav();
        }
    }


    public Activity getActivity() {
        return this;
    }

    @Override
    public void init() {

    }

    @Override
    public void initNav() {

    }

    @Override
    public void loadingData() {

    }

    @Override
    public void onClick(View v) {

    }

    @Override
    public void onHandleMessage(Message message) {

    }
}
